package com.an.blog.service;

import com.an.blog.web.domain.BlogLoginForm;
import com.an.blog.web.domain.bo.BlogForgetUserBo;
import com.an.blog.web.domain.bo.BlogRegisterUserBo;
import com.an.blog.web.domain.vo.BlogAuthorInfoVo;
import com.an.blog.web.domain.vo.BlogUserWebVo;
import com.an.common.core.domain.R;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthUser;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

/**
 * 博客用户Service接口
 *
 * @author Ann
 * @date 2023-05-30
 */
public interface IBlogUserService {

    /**
     * 注册
     *
     * @param registerUserBo 注册用户业务对象
     * @return {@link Map }<{@link String }, {@link Object }>
     * @author: Ann
     * @createDate: 2023/09/01 13:45:41
     * @version: 1.0.0
     */
    Map<String, Object> register(BlogRegisterUserBo registerUserBo);

    /**
     * 登录
     *
     * @param blogLoginForm 博客登录表单
     * @param loginType     登录类型
     * @return {@link Map }<{@link String }, {@link Object }>
     * @author: Ann
     * @createDate: 2023/08/22 10:19:50
     * @version: 1.0.0
     */
    Map<String, Object> login(BlogLoginForm blogLoginForm, String loginType);

    /**
     * 注销
     *
     * @author: Ann
     * @createDate: 2023/06/06 15:23:56
     * @version: 1.0.0
     */
    void logout();


    /**
     * 忘记 PWD
     *
     * @param forgetUserBo 忘记用户 bo
     * @return {@link Boolean }
     * @author Ann
     * @date 2024/08/09
     */
    Boolean forgetPwd(BlogForgetUserBo forgetUserBo);

    /**
     * oauth登录
     *
     * @param response        响应
     * @param source          源
     * @param callback        回调
     * @param servletResponse servlet响应
     * @author: Ann
     * @createDate: 2023/08/28 21:04:53
     * @version: 1.0.0
     */
    void oauthLogin(AuthResponse<AuthUser> response, String source, AuthCallback callback,
                    HttpServletResponse servletResponse) throws IOException;

    /**
     * 让博客用户信息
     *
     * @return {@link R }<{@link BlogUserWebVo }>
     * @author: Ann
     * @createDate: 2023/08/28 20:05:15
     * @version: 1.0.0
     */
    R<BlogUserWebVo> getBlogUserInfo();

    /**
     * 查询博客作者信息
     *
     * @return {@link R }<{@link BlogAuthorInfoVo }>
     * @author Ann
     * @date 2024/08/09
     */
    BlogAuthorInfoVo queryBlogAuthorInfo();
}
